home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_bullbutt.cog < prev    next >
Text File  |  1999-11-15  |  5KB  |  203 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_BullButt.cog
  4. #
  5. # [RKD] [TL] [RT] [GGJ]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols    
  11.  
  12. message        startup
  13. message        activated    
  14. message        arrived        
  15. message        pulse
  16. message        timer
  17.  
  18. thing        door0                                    #door is bull?!
  19. thing        lever
  20. thing        player                            local
  21. thing        indy
  22. thing        camera1            
  23. thing        camera2
  24. thing        bubbleGhost0
  25. thing        bubbleGhost1
  26. thing        tempring0                nolink    local
  27. thing        tempring1                nolink    local
  28. thing        tempring2                nolink    local
  29. thing        tempring3                nolink    local
  30. thing        rotateGhost0
  31. thing        rotateGhost1
  32. thing        ringGhost0
  33. thing        ringGhost1
  34. thing        ringGhost2
  35. thing        ringGhost3
  36.  
  37.  
  38. keyframe    in_pull=in_uw_pullswitch.key    local
  39. sound        startdoor=nub_bull_move1_c.wav    local
  40. sound        movedoor0=nub_bull_move2_c.wav    local
  41. sound        movedoor1=nub_bull_move3_c.wav    local
  42. sound        movedoor2=nub_bull_move4_c.wav    local
  43. sound        movedoor3=nub_bull_move5_c.wav    local
  44. sound        movedoor4=nub_bull_move6_c.wav    local
  45. sound        stopdoor=nub_bull_stop_c.wav    local
  46. sound        bullMus=mus_pyr_intro.wav        local
  47.  
  48. vector        campos                            local
  49.  
  50. template    bubbleparticles0=bullbubbles    local
  51. template    ring=+ripples                    local
  52.  
  53. int            startchannel                    local
  54. int            move0channel                    local
  55. int            move1channel                    local
  56. int            move2channel                    local
  57. int            move3channel                    local
  58. int            move4channel                    local
  59. int            stopchannel                        local
  60. int            begun=0                            local
  61. thing        bubbles0                        local
  62. thing        bubbles1                        local
  63. int            bubbling=0                        local
  64.  
  65. end
  66.  
  67. # ========================================================================================
  68. code
  69.  
  70. startup:
  71.  
  72. player = GetLocalPlayerThing();
  73.  
  74. return;
  75.  
  76. #........................................................................................
  77. activated:
  78.  
  79. if (begun == 1)    return;
  80. begun = 1;
  81. if (GetSenderRef() != lever) return;
  82.     
  83. AttachThingToThing(bubbleGhost0, rotateGhost0);
  84. AttachThingToThing(bubbleGhost1, rotateGhost1);
  85.  
  86. AttachThingToThing(ringGhost0, rotateGhost0);
  87. AttachThingToThing(ringGhost1, rotateGhost1);
  88. AttachThingToThing(ringGhost2, rotateGhost0);
  89. AttachThingToThing(ringGhost3, rotateGhost1);
  90.  
  91.  
  92. Rotate(rotateGhost0, 30, 1, 0.2);
  93.  
  94. StartCutscene(1);
  95. SetThingFlags(player, 0x80000);
  96. StopThing(player);
  97. SetActorFlags(player, 0x200000);
  98.  
  99. SetCameraLookInterp(2, 0);
  100. SetCameraPosInterp(2, 0);
  101. Sleep(0.01);
  102.  
  103. SetCameraFocus(2, camera1);
  104. SetCameraSecondaryFocus(2, indy);
  105. SetCurrentCamera(2);
  106.  
  107. CopyPlayerHolsters(player, indy);
  108. ClearThingFlags(indy, 0x80000);
  109. PlayKey(indy, in_pull, 4, 0x12, 0);
  110. Sleep(1.4);
  111. MoveToFrame(lever, 1, 0.3);
  112.  
  113. Sleep(1.0);
  114. SetCameraFocus(2, camera2);
  115. SetCameraSecondaryFocus(2, door0);
  116. SetCurrentCamera(2);
  117. SetCameraFOV(90, 0, 0.0);
  118.  
  119.  
  120. startchannel = PlaySoundThing(startdoor, door0, 1.0, -1.0, -1.0, 0x0001);
  121. move0channel = PlaySoundThing(movedoor0, door0, 1.0, -1.0, -1.0, 0x0001);
  122. MoveToFrame(door0, 1, 1.5);
  123.  
  124. SetPulse(0.25);    
  125. SetTimer(0.25);
  126. PlaySoundLocal(bullMus, 1.0, 0, 0x0, 0);
  127.  
  128.  
  129. move1channel = PlaySoundThing(movedoor1, door0, 1.0, -1.0, -1.0, 0x0001);
  130. Sleep(2.0);
  131. MoveToFrame(camera2, 1, 1.3);
  132.  
  133. move2channel = PlaySoundThing(movedoor2, door0, 1.0, -1.0, -1.0, 0x0000);
  134. WaitForSound(move2channel);
  135. move3channel = PlaySoundThing(movedoor3, door0, 1.0, -1.0, -1.0, 0x0000);
  136. WaitForSound(move3channel);
  137. move4channel = PlaySoundThing(movedoor4, door0, 1.0, -1.0, -1.0, 0x0000);
  138. WaitForSound(move4channel);
  139.  
  140. bubbling = 1;
  141.  
  142. return;
  143.  
  144. #........................................................................................
  145. arrived:    
  146. if ((GetSenderRef() == rotateGhost0) && (bubbling == 0))
  147. {
  148.     Rotate(rotateGhost0, RandBetween(10, 90) * RandBetween(-1, 1) + 1, 1, RandBetween(1, 2) * 0.1);
  149.     Rotate(rotateGhost1, RandBetween(10, 90) * RandBetween(-1, 1) + 1, 1, RandBetween(1, 2) * 0.1);
  150.     return;
  151. }
  152.  
  153. if (GetSenderRef() == door0)
  154. {
  155.     
  156.     SetPulse(0.0);
  157.     StopSound(startchannel, 0.0);
  158.     StopSound(move0channel, 0.0);
  159.     StopSound(move1channel, 0.0);
  160.     stopchannel = PlaySoundThing(stopdoor, door0, 1.0, -1.0, -1.0, 0x0000);
  161.     WaitForSound(stopchannel);
  162.     
  163.     Sleep(1.0);
  164.     
  165.     SetCurrentCamera(1);
  166.     SetCameraFOV(90, 0, 0.0);
  167.     CopyOrientandPos(indy, player);
  168.     SetThingFlags(indy, 0x80000);
  169.     ClearThingFlags(player, 0x80000);
  170.     ClearActorFlags(player, 0x200000);
  171.     
  172.     EndCutscene();
  173. }
  174.  
  175. return;
  176.  
  177. #........................................................................................
  178. pulse:
  179.  
  180. bubbles0 = CreateThing(bubbleparticles0, bubbleGhost0);
  181. bubbles1 = CreateThing(bubbleparticles0, bubbleGhost1);
  182.  
  183. return;
  184.  
  185. #........................................................................................
  186. timer:
  187. if (bubbling == 1) return;
  188.  
  189. tempring0 = CreateThing(ring, ringGhost0);
  190. AnimateSpriteSize(tempring0, '0.1 0.1 1', '0.3 0.3 0', 2);
  191. tempring1 = CreateThing(ring, ringGhost1);
  192. AnimateSpriteSize(tempring1, '0.1 0.1 1', '0.3 0.3 0', 2);
  193. tempring2 = CreateThing(ring, ringGhost2);
  194. AnimateSpriteSize(tempring2, '0.1 0.1 1', '0.3 0.3 0', 2);
  195. tempring3 = CreateThing(ring, ringGhost3);
  196. AnimateSpriteSize(tempring3, '0.1 0.1 1', '0.3 0.3 0', 2);
  197. SetTimer(0.25);
  198. return;
  199.  
  200.  
  201. #........................................................................................
  202. end
  203.